package com.demo;

//饿汉模式--类一加载立即创建
public class Sinleton2 {
	//构造函数私有
	private Sinleton2(){
		
	}
	private static Sinleton2 instance=new Sinleton2();
	
	//公有方法
	public static Sinleton2 getInstance(){
		return instance;
	}
	
}
